package com.zhiyou100.dao.impl;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.zhiyou100.dao.AdminDao;
import com.zhiyou100.model.Admin;

@Repository
public class AdminDaoImpl implements AdminDao{

	@Resource
	private SessionFactory factory;
	@Override
	public Admin checkAdmin(String login_name, String login_password) {
		return (Admin) factory.getCurrentSession().createQuery("from Admin a where a.login_name=? and a.login_password=?").setParameter(0, login_name).setParameter(1, login_password).uniqueResult();
	}

}
